def gerar_cubos(N):
	for i in range(N):
		yield i ** 3

gen = gerar_cubos(5)

print gen.next()
print gen.next()
print gen.next()
print gen.next()
print gen.next()

print

for y in gerar_cubos(5):
	print y